import PropTypes from 'prop-types'
import React, { memo } from 'react'
import SectionHomeV3Wrapper from './style'
import SectionHeader from '@/components/section-header'
import RoomItem from '@/components/room-item'
import ScrollView from '@/base-ui/scroll-view'
import SectionFooter from '@/components/section-footer'

const SectionHomeV3 = memo((props) => {
  const {itemData} = props
  return (
    <SectionHomeV3Wrapper>
      <SectionHeader title={itemData.title} subtitle={itemData.subtitle}/>
      <ScrollView>
      {
            itemData?.list.map((item) => {
              // RoomItem作为一个li包裹数据传递到RoomItem
              return (<RoomItem itemData={item} itemrWidth="20%" key={item.id}/>)
            })
          }
      </ScrollView>
      <SectionFooter houseName="Plus"/>
    </SectionHomeV3Wrapper>
  )
})

SectionHomeV3.propTypes = {
  itemData: PropTypes.object
}

export default SectionHomeV3